package groupon.user.bo.service.impl;

import groupon.user.bo.service.AccountService;
import groupon.user.bo.service.ServiceException;
import groupon.user.dao.AccountDao;
import groupon.user.model.Account;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service(value = AccountService.SERVICE_ID)
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class AccountServiceImpl implements AccountService {

	@Resource(name = "accountDao")
	private AccountDao _accountDao;
	
	@Transactional
	public Account findAccountByUsername(String username) throws ServiceException {
		return _accountDao.findAccountByUsername(username);
	}

	@Transactional
	public void initializer() {
		_accountDao.initializer();
	}

	public Account findAccountbyEmail(String email) throws ServiceException {
		return _accountDao.findAccountbyEmail(email);
	}
}
